package br.com.ozsolucoes.managedbean.negocio.servico;

import java.util.List;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.model.SelectItem;

import br.com.ozsolucoes.entity.Cliente;
import br.com.ozsolucoes.entity.Servico;
import br.com.ozsolucoes.managedbean.base.BaseManagedBean;
import br.com.ozsolucoes.sessionbeans.ServicoSessionBean;
import br.com.ozsolucoes.util.ClienteSessaoManagedBean;

@ViewScoped
@ManagedBean
public class HistoricoServicoManagedBean extends BaseManagedBean {

	public HistoricoServicoManagedBean() {
		super();
		status[0] = new SelectItem("1", "Ativo");
		status[1] = new SelectItem("2", "Cancelado");
	}

	private Cliente cliente = ClienteSessaoManagedBean.getInstance().getClienteSessao();

	@EJB
	private ServicoSessionBean servicoSessionBean;

	private SelectItem[] status = new SelectItem[2];

	public List<Servico> servicosCliente() {
		return servicoSessionBean.consultarTodosServicosCliente(cliente.getId());
	}
	public SelectItem[] getStatus() {
		return status;
	}
}